package com.imooc.article.stream;

import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.stereotype.Component;

/**
 * @Description : 构建消费端
 * @Author : YTY
 * @Date : 2020-12-11 13:36
 */

@Component
@EnableBinding(MyStreamChannel.class)
public class MyStreamConsumer {

    /**
     * 监听并实现消息的消费、业务相关逻辑处理
     */
//    @StreamListener(MyStreamChannel.INPUT)
//    public void receiveMsg(AppUser user) {
//
//        System.out.println(user.toString());
//    }

    @StreamListener(MyStreamChannel.INPUT)
    public void receiveMsg(String dumpling) {

        System.out.println(dumpling);
    }

}
